//
//  UIDevice+Camera.m
//  Meng800
//
//  Created by 姚宗超 on 14-8-5.
//  Copyright (c) 2014年 点财网. All rights reserved.
//

#import "UIDevice+Camera.h"
#import <AssetsLibrary/AssetsLibrary.h>
#import <MobileCoreServices/MobileCoreServices.h>

@implementation UIDevice (Common)

#pragma mark Interface

- (BOOL)hasRetinaDisplay
{
    return [UIScreen mainScreen].scale == 2.0;
}

- (BOOL)has4InchDisplay
{
    return [[UIScreen mainScreen] bounds].size.height == 568;
}

+ (BOOL)isJailBreak
{
    BOOL cydia = NO;
    BOOL binBash = NO;
    NSString *filePath = @"/Applications/Cydia.app";
    if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
    {
        cydia = YES;
    }
    
    FILE * f = fopen("/bin/bash", "r");
    if (f != NULL)
    {
        binBash = YES;
    }
    fclose(f);
    
    if (cydia || binBash) {
        return YES;
    } else {
        return NO;
    }
}

@end
